import request from '@/utils/request'

export function getCartInfo() {
  return request({
    url: '/carts',
    method: 'get'
  })
}

export function getSelect() {
  return request({
    url: '/carts/isSelect',
    method: 'get'
  })
}

export function addCart(data) {
  return request({
    url: '/carts',
    method: 'post',
    data
  })
}

export function deleteCart(data) {
  return request({
    url: '/carts',
    method: 'delete',
    data
  })
}

export function updateCart(id, data) {
  return request({
    url: `/carts/${id}`,
    method: 'patch',
    data
  })
}

export function selectAllChange(data) {
  return request({
    url: `/carts/selectAllChange`,
    method: 'post',
    data
  })
}